package com.hoo.controller.account;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hoo.service.account.VisitorService;
import com.hoo.service.order.TicketOrderService;

@Controller
public class IndexController extends BaseController{
	@Autowired
	VisitorService visitorService;
	
	@Autowired
	TicketOrderService ticketOrderService;
	
	@RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index(Model model, HttpServletRequest request) {
		return "redirect:/sign_in";
    }
	
	@RequestMapping(value = "/test", method = RequestMethod.GET)
    public String test(Model model, HttpServletRequest request) {
		long time1=System.currentTimeMillis();
		for (int i = 0; i <100000; i++) {
			System.err.println(System.currentTimeMillis()-time1);
			System.err.println(i);
			String string = "{\"startTime\":\"2013/07/01\",\"birthday\":\"1992/08/12\",\"address\":\"安徽省蒙城县篱笆镇王庙村王海庄３１号\",\"name\":\"王春标\",\"gender\":\"1\",\"identityCard\":\"341224199208120979\",\"endTime\":\"2023/07/01\",\"signAndIssue\":\"蒙城县公安局\",\"nationId\":\"01\"}";
			try {				
				this.visitorService.handleInsertVisitorEvent(string);
				this.ticketOrderService.getTicketOnUse();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return "redirect:/sign_in";
    }
}

